

import { defineStore } from 'pinia';
import { store } from '../index';

export const useLoadingStore = defineStore({
    id: 'app-loading',
    state: () => ({
        loadingStatus: false, // 子应用渲染动画开关
    }),
    getters: {
        getLoadingStatus(): boolean {
            return this.loadingStatus;
        },
    },
    actions: {
        setLoadingStatus(flag: boolean) {
            this.loadingStatus = flag;
        },
    },
});


// Need to be used outside the setup
export function useLoadingStoreWithOut() {
    return useLoadingStore(store);
}
